﻿using System;
using Present.Commands.Async.Actions;

namespace Present.Commands.Fluent
{
    public class SimpleActionBuilder<TParameter, TResult> : ActionBuilder<TParameter, TResult>
    {
        private readonly Func<IAsyncAction<TParameter, TResult>> makeAction;


        public SimpleActionBuilder(Func<IAsyncAction<TParameter, TResult>> makeAction)
        {
            this.makeAction = makeAction;
        }


        protected override IAsyncAction<TParameter, TResult> GetAction()
        {
            return makeAction();
        }

    }
}